﻿using System;
using System.Collections.Generic;
using System.Resources;

namespace PiUi
{
    public static class ThemeLanguage
    {

        static  ResourceManager rm = new ResourceManager("PiUi.Properties.languageZH", typeof(Program).Assembly);

        
        static  int languageIndex = 0;
        public static List<string> m_LanguageList = new List<string>()
        {
             "zh-CN",
             "en-US",
             "vi-VN",
             "ja-JP",
             "ko-KR"

        };
        
        public static void ChangeLanguage() { 

            languageIndex = (languageIndex + 1) % m_LanguageList.Count;
            string language = m_LanguageList[languageIndex];
            if (language == "zh-CN")
            {
                rm = new ResourceManager("PiUi.Properties.languageZH", typeof(Program).Assembly);
            }else if (language == "en-US")
            {
                rm = new ResourceManager("PiUi.Properties.languageEN", typeof(Program).Assembly);
            }
            else if (language == "vi-VN")
            {
                rm = new ResourceManager("PiUi.Properties.languageVI", typeof(Program).Assembly);
            }
            else if (language == "ja-JP")
            {
                rm = new ResourceManager("PiUi.Properties.languageJA", typeof(Program).Assembly);
            }
            else if (language == "ko-KR")
            {
                rm = new ResourceManager("PiUi.Properties.languageKO", typeof(Program).Assembly);
            }
        
        }
        public static string GetString(string key)
        {

            if (rm == null)
            {
              Console.WriteLine("Language not set");
            }
            string labelName = rm.GetString(key);
            

            return labelName;
        }
    }

    
}
